package one.stand.mapper;

import one.stand.model.essay.EssayVisitorsDataModel;
import one.stand.model.essay.VisitorsDetailModel;
import one.stand.request.essay.EssayVisitorsDataForm;
import one.stand.request.essay.EssayVisitorsDataRequest;
import one.stand.request.essay.VisitorsDetailQuery;
import one.stand.response.essay.EssayVisitorsDataResponse;
import one.stand.response.essay.VisitorsResponse;

import java.util.List;

/**
 * <p>
 * 获客文章访客数据 Mapper 接口
 * </p>
 *
 * @author luoyang
 * @since 2020-05-07
 */
public interface EssayVisitorsDataMapper {

    List<EssayVisitorsDataResponse> queryVisitorsData(EssayVisitorsDataRequest request);

    int deleteById(EssayVisitorsDataModel model);

    int update(EssayVisitorsDataModel model);

    int insert(EssayVisitorsDataModel model);

    List<EssayVisitorsDataModel> queryAll(EssayVisitorsDataModel model);

    EssayVisitorsDataModel queryById(EssayVisitorsDataModel model);

    /**
     * 按来源 用户 业务员 公司 查询
     * @param model
     * @return
     */
    EssayVisitorsDataModel queryVisitors(EssayVisitorsDataForm model);


    List<VisitorsDetailModel> queryDynamicVisitorsDetail(VisitorsDetailQuery request);

    /**
     * 按openid和文章查询是否有访问过文章
     * @param openId
     * @param dynamicId
     * @return
     */
    EssayVisitorsDataModel queryByOpenId(String openId,Integer dynamicId);

    /**
     * 更新访问时间
     * @param visitorsDataModel
     * @return
     */
    int upateTime(EssayVisitorsDataModel visitorsDataModel);
}
